 <?php
require('includes/top.php');
$name = $_POST["fname"]." ".$_POST["lname"];	
$email = $_POST["email"];
$comp_name=$_POST['company_name'];
$tel=$_POST['tel_code']."-".$_POST["phone"];
$mob=$_POST['mob_code']."-".$_POST["mob"];
$question=$_POST['question'];

$target_path="files/";
if(move_uploaded_file($_POST['upload_query'], $target_path))
{
	$filepath=$target_path.'/'.$_POST['upload_query'];
	$sql="INSERT INTO question_asked(`name`,`email`,`comp_name`,`tel`,`mob`,`upload_file`) VALUES ('$name','$email','$comp_name','$tel','$mob','$filepath')";
}
else
{
$sql="INSERT INTO question_asked(`name`,`email`,`comp_name`,`tel`,`mob`) VALUES ('$name','$email','$comp_name','$tel','$mob')";
}
	
	$result=mysql_query($sql);
 if($result)
 {
header("location:search_question.php?question=".$question);
 }
 else
 {
	 echo mysql_error();
 }
ob_flush();
?>


